let stream = require('stream');
let fs=require('fs');
let rws = new fs.createReadStream('assets/input.text');
let wws = new fs.createWriteStream('out.txt');

/*ddfd ---> DDFD  */
function transformStream_ToUper(){
    var ts = stream.Transform();
    ts._transform = function(chunk,enc,next){  // enc 代表编码格式
        chunk = chunk.toString().toUpperCase();
        ts.push(chunk);
        next();
    }
    return ts;
}

tws = transformStream_ToUper();
rws.pipe(tws).pipe(wws);
